package com.jd.controller;

import com.jd.model.Response;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @author wangshuping
 * @version 1.0
 * @date 2021/12/17 11:09
 */
@RestController
@RequestMapping("sentinel")
public class SentinelTestController {

    @GetMapping("/get/{str}")
    public Response<String> test(@PathVariable("str") String str){
        try {
            TimeUnit.MILLISECONDS.sleep(800);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return Response.ok(str);
    }

}
